package com.dream.cgomall.dao;

import com.dream.cgomall.entity.CgoAdminAddress;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (CgoAdminAddress)表数据库访问层
 *
 * @author makejava
 * @since 2021-07-07 15:07:22
 */
@Mapper
public interface CgoAdminAddressDao {
    //添加收货地址
    int insertAddress(CgoAdminAddress cgoAdminAddress);
    //通过用户id将默认地址修改为非默认
    int updateother(@Param("userId")Integer userId,@Param("id") Integer id);
    //用过用户id查询用户的所有收货地址
    List<CgoAdminAddress> selectAllByUserId(Integer userId);
    //修改用户收货地址
    int updateAddress(CgoAdminAddress cgoAdminAddress);
    //删除收货地址
    int deleteById(Integer id);
    //查找用户的默认地址
    CgoAdminAddress findDefaultByUserId(Integer userId);
    //通过评论ID查询评论
    CgoAdminAddress findAddressById(Integer addId);
}

